Open(kdevt dev, int purpose)

Open() should try to open the device for a specific purpose, which can be either:
0 Open for data read, as is used by mount() (2), or the user commands dd or cat.
1 Open for ioctl commanding, as is used for audio-CD playing programs mostly.
In this routine, a static counter should be updated, reflecting the number of times the specific device is successfully opened (and in case the driver supports modules, the call MODINCUSECOUNT should be performed exactly once, if successful). The return value is negative on error, and zero on success. The open-for-ioctl call can only fail if there is no hardware.

Notice that any strategic code (closing tray upon open(), etc.) is done by the calling routine in cdrom.c, so the low-level routine should only be concerned with proper initialization and device-use count.